package com.yuke.cloud.common.core.config;

import com.yuke.cloud.common.config.properties.YukeProperties;
//import com.yuke.cloud.common.zk.registry.RegistryCenterFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.core.annotation.Order;
//import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.net.InetAddress;

/**
 * The class Redis init runner.
 *
 * @author
 */
//@Component  //todo 本项目暂不支持zk，注释掉
//@Order
@Slf4j
public class ZookeeperInitRunner implements CommandLineRunner {
	@Resource
	private YukeProperties yukeProperties;
	@Value("${spring.application.name}")
	private String applicationName;

	/**
	 * Run.
	 *
	 * @param args the args
	 *
	 * @throws Exception the exception
	 */
	@Override
	public void run(String... args) throws Exception {
//本项目中暂没有用到zookeeper，注释掉
//		String hostAddress = InetAddress.getLocalHost().getHostAddress();
//		log.info("###ZookeeperInitRunner，init. HostAddress={}, applicationName={}", hostAddress, applicationName);
//		RegistryCenterFactory.startup(yukeProperties, hostAddress, applicationName);
//		log.info("###ZookeeperInitRunner，finish<<<<<<<<<<<<<");
	}

}